package com.manager.model;

import jakarta.persistence.*;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;
import org.springframework.scheduling.annotation.Scheduled;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

@SuppressWarnings("all")
@Entity
@Table(name="tb_docker_deploy")
public class DockerDeploy extends AllId{

    private String imageName;

    private String imageTag;

    private String imageID;

    private String imageTableId;

    private String containerID;

    private String containerName;

    private Integer containerType;

    private String processName;

    private String runModel;

    private String volumes;

    private String resourceInfo;

    private Integer deployState;

    private String runState;

    private Integer hasEnter;

    private BigDecimal cpu;

    private BigDecimal memory;

    private BigDecimal disk;

    private Integer volumeType;

    private String networkIp;

    private String dockerEnvFilePath;

    private Integer paramsFileType;

    private String paramsFilePath;

    private String interfaceAddress;

    private String requestType;

    private String interfaceDesc;

    private String settingFilePath;

    private String dbName;

    private String dbIp;

    private String dbUserName;

    private String dbPassword;

    private String networkName;

    private String realTimeCpu;

    private String realTimeMemory;

    private String realTimeDisk;

    private String realTimeNetwork;

    private String ports;

    private Integer hasEnableBackup;

    private String scheduledCorn;

    private DockerImages dockerImages;

    private List<DockerDeployVolume> dockerDeployVolumeList = new ArrayList<>();

    private List<DockerDeployNetwork> dockerDeployNetworkList = new ArrayList<>();

    private List<SchedulingStrategyDockerContainer> schedulingStrategyDockerContainerList = new ArrayList<>();

    public static String[] config = {"dockerDeployList","deploy","schedulingStrategyDockerContainerList"};

    @OneToMany(fetch = FetchType.LAZY,orphanRemoval=true,mappedBy = "dockerDeploy")
    public List<SchedulingStrategyDockerContainer> getSchedulingStrategyDockerContainerList() {
        return schedulingStrategyDockerContainerList;
    }

    public void setSchedulingStrategyDockerContainerList(List<SchedulingStrategyDockerContainer> schedulingStrategyDockerContainerList) {
        this.schedulingStrategyDockerContainerList = schedulingStrategyDockerContainerList;
    }


    @OneToMany(fetch = FetchType.LAZY,orphanRemoval=true,mappedBy = "deploy")
    public List<DockerDeployNetwork> getDockerDeployNetworkList() {
        return dockerDeployNetworkList;
    }

    public void setDockerDeployNetworkList(List<DockerDeployNetwork> dockerDeployNetworkList) {
        this.dockerDeployNetworkList = dockerDeployNetworkList;
    }

    @OneToMany(fetch = FetchType.LAZY,orphanRemoval=true,mappedBy = "deploy")
    public List<DockerDeployVolume> getDockerDeployVolumeList() {
        return dockerDeployVolumeList;
    }

    public void setDockerDeployVolumeList(List<DockerDeployVolume> dockerDeployVolumeList) {
        this.dockerDeployVolumeList = dockerDeployVolumeList;
    }

    @Transient
    public String getImageName() {
        return imageName;
    }

    public void setImageName(String imageName) {
        this.imageName = imageName;
    }

    public String getContainerName() {
        return containerName;
    }

    public void setContainerName(String containerName) {
        this.containerName = containerName;
    }

    public Integer getContainerType() {
        return containerType;
    }

    public void setContainerType(Integer containerType) {
        this.containerType = containerType;
    }

    public String getProcessName() {
        return processName;
    }

    public void setProcessName(String processName) {
        this.processName = processName;
    }

    public String getRunModel() {
        return runModel;
    }

    public void setRunModel(String runModel) {
        this.runModel = runModel;
    }

    public String getVolumes() {
        return volumes;
    }

    public void setVolumes(String volumes) {
        this.volumes = volumes;
    }

    public String getResourceInfo() {
        return resourceInfo;
    }

    public void setResourceInfo(String resourceInfo) {
        this.resourceInfo = resourceInfo;
    }

    public String getRunState() {
        return runState;
    }

    public void setRunState(String runState) {
        this.runState = runState;
    }

    public Integer getDeployState() {
        return deployState;
    }

    public void setDeployState(Integer deployState) {
        this.deployState = deployState;
    }

    @Transient
    public String getImageID() {
        return imageID;
    }

    public void setImageID(String imageID) {
        this.imageID = imageID;
    }

    public String getContainerID() {
        return containerID;
    }

    public void setContainerID(String containerID) {
        this.containerID = containerID;
    }

    public Integer getHasEnter() {
        return hasEnter;
    }

    public void setHasEnter(Integer hasEnter) {
        this.hasEnter = hasEnter;
    }

    @ManyToOne
    @Cascade(CascadeType.PERSIST)
    public DockerImages getDockerImages() {
        return dockerImages;
    }

    public void setDockerImages(DockerImages dockerImages) {
        this.dockerImages = dockerImages;
    }

    public String getImageTableId() {
        return imageTableId;
    }

    public void setImageTableId(String imageTableId) {
        this.imageTableId = imageTableId;
    }

    public BigDecimal getCpu() {
        return cpu;
    }

    public void setCpu(BigDecimal cpu) {
        this.cpu = cpu;
    }

    public BigDecimal getMemory() {
        return memory;
    }

    public void setMemory(BigDecimal memory) {
        this.memory = memory;
    }

    public BigDecimal getDisk() {
        return disk;
    }

    public void setDisk(BigDecimal disk) {
        this.disk = disk;
    }

    public String getDockerEnvFilePath() {
        return dockerEnvFilePath;
    }

    public void setDockerEnvFilePath(String dockerEnvFilePath) {
        this.dockerEnvFilePath = dockerEnvFilePath;
    }

    public String getParamsFilePath() {
        return paramsFilePath;
    }

    public void setParamsFilePath(String paramsFilePath) {
        this.paramsFilePath = paramsFilePath;
    }

    public String getInterfaceAddress() {
        return interfaceAddress;
    }

    public void setInterfaceAddress(String interfaceAddress) {
        this.interfaceAddress = interfaceAddress;
    }

    public String getRequestType() {
        return requestType;
    }

    public void setRequestType(String requestType) {
        this.requestType = requestType;
    }

    public String getInterfaceDesc() {
        return interfaceDesc;
    }

    public void setInterfaceDesc(String interfaceDesc) {
        this.interfaceDesc = interfaceDesc;
    }

    public String getSettingFilePath() {
        return settingFilePath;
    }

    public void setSettingFilePath(String settingFilePath) {
        this.settingFilePath = settingFilePath;
    }

    public String getDbName() {
        return dbName;
    }

    public void setDbName(String dbName) {
        this.dbName = dbName;
    }

    public String getDbIp() {
        return dbIp;
    }

    public void setDbIp(String dbIp) {
        this.dbIp = dbIp;
    }

    public String getDbUserName() {
        return dbUserName;
    }

    public void setDbUserName(String dbUserName) {
        this.dbUserName = dbUserName;
    }

    public String getDbPassword() {
        return dbPassword;
    }

    public void setDbPassword(String dbPassword) {
        this.dbPassword = dbPassword;
    }

    public Integer getParamsFileType() {
        return paramsFileType;
    }

    public void setParamsFileType(Integer paramsFileType) {
        this.paramsFileType = paramsFileType;
    }

    public Integer getVolumeType() {
        return volumeType;
    }

    public void setVolumeType(Integer volumeType) {
        this.volumeType = volumeType;
    }

    public String getNetworkIp() {
        return networkIp;
    }

    public void setNetworkIp(String networkIp) {
        this.networkIp = networkIp;
    }

    public String getNetworkName() {
        return networkName;
    }

    public void setNetworkName(String networkName) {
        this.networkName = networkName;
    }

    @Transient
    public String getRealTimeCpu() {
        return realTimeCpu;
    }

    public void setRealTimeCpu(String realTimeCpu) {
        this.realTimeCpu = realTimeCpu;
    }

    @Transient
    public String getRealTimeMemory() {
        return realTimeMemory;
    }

    public void setRealTimeMemory(String realTimeMemory) {
        this.realTimeMemory = realTimeMemory;
    }

    @Transient
    public String getRealTimeDisk() {
        return realTimeDisk;
    }

    public void setRealTimeDisk(String realTimeDisk) {
        this.realTimeDisk = realTimeDisk;
    }

    @Transient
    public String getRealTimeNetwork() {
        return realTimeNetwork;
    }

    public void setRealTimeNetwork(String realTimeNetwork) {
        this.realTimeNetwork = realTimeNetwork;
    }

    @Transient
    public String getPorts() {
        return ports;
    }

    public void setPorts(String ports) {
        this.ports = ports;
    }

    @Transient
    public String getImageTag() {
        return imageTag;
    }

    public void setImageTag(String imageTag) {
        this.imageTag = imageTag;
    }

    public Integer getHasEnableBackup() {
        return hasEnableBackup;
    }

    public void setHasEnableBackup(Integer hasEnableBackup) {
        this.hasEnableBackup = hasEnableBackup;
    }

    public String getScheduledCorn() {
        return scheduledCorn;
    }

    public void setScheduledCorn(String scheduledCorn) {
        this.scheduledCorn = scheduledCorn;
    }
}
